package com.Txunda.fxw.ui.activity.other;

import java.util.Map;

import com.Txunda.fxw.R;
import com.Txunda.fxw.base.utils.util.JSONUtils;
import com.Txunda.fxw.ui.base.BaseAty;
import com.Txunda.fxw.ui.http.AboutUs;
import com.lidroid.xutils.view.annotation.ViewInject;

import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.TextView;
/**
 * 公告界面
 * @author Administrator
 *
 */
public class NoticeAty extends BaseAty {

	@ViewInject(R.id.aty_title3_tv_center)
	private TextView aty_title3_tv_center;
	@ViewInject(R.id.web_notice)
	private WebView web_notice;
	private AboutUs aboutUs;
	private WebSettings set;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		set = web_notice.getSettings();
		set.setTextSize(WebSettings.TextSize.SMALLER);

		showProgressDialog();
		aboutUs.notice(this);
	}

	@Override
	protected int getLayoutResId() {
		return R.layout.aty_notice;
	}

	@Override
	public void onComplete(String requestUrl, String jsonStr) {
		super.onComplete(requestUrl, jsonStr);
		if(requestUrl.contains("notice")){    //公告
			Map<String, String> map = JSONUtils.parseKeyAndValueToMap(jsonStr);
			if("success".equals(map.get("flag"))){
				String data = map.get("data");
				web_notice.loadDataWithBaseURL(null, data, "text/html", "utf-8", null);
			}
		}
	}

	@Override
	protected void initialized() {
		aty_title3_tv_center.setText("公告");
		aboutUs =new AboutUs();
	}

	@Override
	protected void requestData() {

	}


}
